﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevFx.Model;

namespace DevFx.Biz
{
    public class DicBiz : BaseBiz<BdDic>
    {
        public static List<BdDic> GetList()
        {
            using (Model.Entities db = new Entities())
            {
                IQueryable<BdDic> dics = from d in db.BdDics orderby d.OrderNo ascending select d;
                return dics.ToList();
            }
        }
        //public void test()
        //{
        //    //ExecuteCallBackHandler handler=new ExecuteCallBackHandler(Save1);
        //    //handler+=new ExecuteCallBackHandler(Save2);
        //    base.ExecuteService(() => {

        //        Save1(1);
        //        Save2(2);
        //    });
         
        //}

        //public void test(int aa)
        //{
        //    //ExecuteCallBackHandler handler=new ExecuteCallBackHandler(Save1);
        //    //handler+=new ExecuteCallBackHandler(Save2);
        //    base.ExecuteService(() =>
        //    {

        //        Save1(1);
        //        Save2(2);
        //    });

        //}
        public void Save1(int i)
        {
            BdDic dt = new BdDic();
            dt.DicID = Guid.NewGuid();
            //dt.CreateDate = DateTime.Now;
            Create(dt);
        }
        public void Save2(object a)
        {
            BdDic dt1 = new BdDic();
            dt1.DicID = Guid.NewGuid();
            //dt1.CreateDate = DateTime.Now;

            Create(dt1);
            //throw new OutOfMemoryException("test");
        }

    }
}
